home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / Format / asn / asn_proc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-18  |  1.1 KB  |  59 lines

  1. /* asn_proc - decode/read stdin, call filter, encode/output stdout */ 
  2.  
  3. # ifndef lint
  4. static char Rcsid[] = "@(#)$Header: /xtel/pp/pp-beta/Format/asn/RCS/asn_proc.c,v 6.0 1991/12/18 20:15:43 jpo Rel $";
  5. # endif
  6.  
  7. /*
  8.  * $Header: /xtel/pp/pp-beta/Format/asn/RCS/asn_proc.c,v 6.0 1991/12/18 20:15:43 jpo Rel $
  9.  *
  10.  * $Log: asn_proc.c,v $
  11.  * Revision 6.0  1991/12/18  20:15:43  jpo
  12.  * Release 6.0
  13.  *
  14.  */
  15.  
  16.  
  17.  
  18. #include    "head.h"
  19. #include    "asn.h"
  20.  
  21.  
  22.  
  23.  
  24. /* ------------------------  Start Routine  --------------------------------- */
  25.  
  26.  
  27.  
  28.  
  29. /* --- *** ---- 
  30. 1)    Read plain or ASN1 - and decode if required.
  31. 2)    Call the body part filter 
  32. 3)    Encode if required - and output the info on stdout.
  33. --- *** --- */ 
  34.  
  35.  
  36. asn_process(ap)
  37. ASNCMD    *ap;
  38. {
  39.     ASNBODY        *data;
  40.  
  41.     PP_TRACE (("asn_process(%x)", ap));
  42.  
  43.     data = NULLASNBODY;
  44.  
  45.     asn_decode (ap->in_asn.ffunc, &data);
  46.  
  47.     switch (lexequ (ap -> in_charset, ap -> out_charset)) {
  48.     case 0:
  49.         PP_NOTICE (("'%s' = '%s' - No character set conversion done",
  50.                 ap->in_charset, ap->out_charset));
  51.         break;
  52.     default:
  53.         asn_charset (ap->in_charset, ap->out_charset, data );
  54.         break;
  55.     }
  56.  
  57.     asn_encode (ap->out_asn.ffunc, data);
  58. }
  59.